<script setup>
import { useRouter } from 'vue-router';
const router = useRouter();
//创建一个点击事件来绑定路由
const my=()=>{
  router.push('/login');
}
const handleClick = () => {

}

</script>

<template>
  <div class="menu">
    <div class="breadcrumbs">
      <el-breadcrumb separator="/">
        <el-breadcrumb-item :to="{ path: '/' }">主页  ></el-breadcrumb-item>
        <el-breadcrumb-item :to="{ path: '/' }">一级导航  ></el-breadcrumb-item>
        <el-breadcrumb-item>二级导航  ></el-breadcrumb-item>
        <el-breadcrumb-item>三级导航</el-breadcrumb-item>
      </el-breadcrumb>
    </div>
    <div class="menubar">
      <div class="button" v-for="item in 8" :key="item">
        <el-dropdown split-button type="primary" @click="handleClick">
          操作
          <template #dropdown>
            <el-dropdown-menu>
              <el-dropdown-item @click="my()">Action 1</el-dropdown-item>
              <el-dropdown-item>Action 2</el-dropdown-item>
              <el-dropdown-item>Action 3</el-dropdown-item>
              <el-dropdown-item>Action 4</el-dropdown-item>
              <el-dropdown-item>Action 5</el-dropdown-item>
            </el-dropdown-menu>
          </template>
        </el-dropdown>
      </div>
    </div>
  </div>
</template>
<style scoped>
  .menu{
    position: relative;
    width: 100%;
    height: 50%;
    background-color: #E3FBF6FF;
  }
  .breadcrumbs{
    position: relative;
    top: 10%;
  }
  .menubar{
    position: relative;
    top: 20%;
  }
  .button{
    width: 11%;
    float: left;
    margin-left: 1%;
  }
</style>